const config = require('./config4')
const CanvasDarwPoster = require('../index')
const express = require('express')
const app = express()

app.get('/', async (req,res) => {
  let canvasPoster = new CanvasDarwPoster(config)
  await canvasPoster.init()
  let buf3 = canvasPoster.cratePosterImage()

  let html = `
  <div>123</div>
  <image src="${buf3}" /> 
  <script>
  console.log("${buf3}")
  </script>
  `
  res.send(html)
})

let port = 3000;
app.listen(port,function name(params) {
  console.log(`start: http://localhost:${port}`)
})
 